Ext.Loader.setConfig({
	enabled : true
});

Ext.application({
	name : 'Inbox',
	appFolder : '/DataXplore/resources/js/athenaeum',
	controllers : [ 'InboxController' ],
	launch : function() {
		Ext.create('Ext.container.Viewport', {
			layout : {
				type : 'border'
			},
			items : [ this.createFolderPanel(), this.createFolderTab() ]
		});

		this.callParent(arguments);
	},

	createFolderPanel : function() {
		this.folderPanel = Ext.create('widget.folderPanel', {
			region : 'west',
			width : 300,
			minWidth : 175,
			collapsible : true,
			split : true,
			margin : '51 0 33 0',
			listeners : {
				scope : this,
				folderselect : this.onFolderSelect
			}
		});
		return this.folderPanel;
	},

	createFolderTab : function() {
		this.folderTab = Ext.create('widget.folderTab', {
			region : 'center',
			margin : '52 0 33 0'
		});
		return this.folderTab;
	},

	onFolderSelect : function(folderDetail, title, url) {
		this.folderTab.showFolder(title, url);
	}

});
